import request from '@/utils/request.js'

// 通过接口获取文章列表
export function getArticleList (params) {
  return request({
    url: '/v1_1/articles',
    params
  })
}
// 全部频道列表
export function getAllChannel () {
  return request({
    url: '/v1_0/channels'

  })
}
// 获取文章列表
export function getArticleDetail (id) {
  return request({
    url: '/v1_0/articles/' + id
  })
}
// 获取收藏id
export function addCollectArticle (target) {
  return request({
    url: '/v1_0/article/collections',
    method: 'POST',
    data: {
      target
    }
  })
}
// 获取取消收藏id
export function deleteCollectArticle (target) {
  return request({
    url: '/v1_0/article/collections/' + target,
    method: 'DELETE',
    data: {
      target
    }
  })
}
// 获取评论或评论回复
export function getcommitlist (params) {
  return request({
    url: '/v1_0/comments',
    // method: 'GET',
    params
  })
}
// 发布评论或评论回复
export function postcommitlist (data) {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data
  })
}
